<html>
<head>

    <link rel="stylesheet" type="text/css" href="stylesheets/app.css" />

    <script type="text/javascript" src="javascripts/app.js"></script>
    <script type="text/javascript" src="javascripts/ajax.js"></script>
    <script type="text/javascript" src="javascripts/helper.js"></script>
</head>
<body>
<div id="mainDiv">
    <table id="mainTable">
        <tr>
            <td>
                <div id="timer"></div>
                <div id="board"></div>

                <input type="text" id="wordInput" style="display:none" onkeypress="return submitWord(event)"/>
                <div id="wordResult"></div>
            </td>
            <td>
                <div id="wordList"></div>
            </td>
        </tr>
    </table>
</div>
<div id="results" style="display:none"></div>
<div id="startDiv" style="display:none">
    <input type="text" name="timeLimit" id="timeLimit" size="3" value="90"/><input type="button" name="start" value="Start New Game" onclick="javascript:newGame()"/>
</div>
<div id="quitDiv" style="display:none">
    <input type="button" name="quit" value="Vote Quit" onclick="javascript:voteQuit()"/>
</div>

<script type="text/javascript">

    function getParameterByName(name) {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
                results = regex.exec(location.search);
        return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }

    var hangoutId = getParameterByName('hangoutId');
    hangoutId = (hangoutId)?hangoutId:'h1';
    var userId = getParameterByName('userId');
    userId = (userId)?userId:'u1';
    var timeLimit = 10;

    document.addEventListener('timerExpired', function() {
        testResults();
    });

    register();

    document.getElementById('startDiv').style.display = 'block';
</script>

</body>
</html>


